# Contributor: shum <shum@posteo.net>
# Maintainer: shum <shum@posteo.net>
pkgname=lgogdownloader
pkgver=3.8
pkgrel=2
pkgdesc="Open source downloader for GOG.com games"
url="https://github.com/Sude-/lgogdownloader"
arch="all"
license="WTFPL"
options="!check" # no testsuite
makedepends="help2man cmake boost-dev tinyxml2-dev jsoncpp-dev rhash-dev curl-dev htmlcxx-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Sude-/lgogdownloader/archive/refs/tags/v$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake  -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DUSE_QT_GUI=OFF \
		$CMAKE_CROSSOPTS

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
28d5ca08c4cd879437a9616df9832ff4962dd41a810eff36cde1746663fc5d26ebd50ecfc56c7ee1cfc38112efa3705af8e868e6382fe85d0c5c3d5b056cc69c  lgogdownloader-3.8.tar.gz
"
